package com.pelli.imarket.client.models.columns.config;

import java.util.List;

import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.widget.grid.ColumnConfig;
import com.extjs.gxt.ui.client.widget.grid.ColumnModel;
import com.extjs.gxt.ui.client.widget.grid.Grid;
import com.google.gwt.user.client.rpc.AsyncCallback;

public class GridLoader implements AsyncCallback<List<ColumnConfig>> {

	private Grid grid = null;
	private ListStore store=new ListStore();

	private boolean _return = false; 
	@Override
	public void onFailure(Throwable caught) {
		// TODO Auto-generated method stub
		System.out.println("ColumnConfigLoader.onFailure()"+caught);
	}

	@Override
	public void onSuccess(List<ColumnConfig> result) {
		setGrid(new Grid(store,new ColumnModel(result)));
	}

	public Grid getGrid() {
		return grid;
	}

	protected void setGrid(Grid grid) {
		this.grid = grid;
	}

	

}
